package com.rtwo.tio.common.heartbeat;

import com.rtwo.tio.common.BasicHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tio.core.ChannelContext;

import java.io.UnsupportedEncodingException;

/**
 * Created by hasee on 2018/7/17.
 */
public class HeartBeatHandler extends BasicHandler<HeartBeatMsg> {

    private Logger logger = LoggerFactory.getLogger(HeartBeatHandler.class);

    @Override
    public Class<HeartBeatMsg> getClazz() {
        return HeartBeatMsg.class;
    }

    @Override
    public void postHanlder(HeartBeatMsg body, ChannelContext channelContext) throws UnsupportedEncodingException {
        logger.info("收到心跳包,时间为{}",body.getT());
    }
}
